Skip to content

chore: remove unused member_type from member_email_deliveries - #2829

Merged
mroderick merged 1 commit into
masterfrom
chore/remove-unused-member-type
Aug 31, 2026
Merged

chore: remove unused member_type from member_email_deliveries#2829
mroderick merged 1 commit into
masterfrom
chore/remove-unused-member-type

Conversation

@mroderick

@mroderick mroderick commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

member_email_deliveries.member_type is dead weight. It was added in #2449 (same day as the table) for polymorphism that was never built: the model is a plain belongs_to :member, the EmailDelivery concern never writes it, nothing reads it, and it is NULL in all 439 production rows.

Change

  • Drop the column (safety_assured — same single-phase pattern as the can_log_in removal in 20260806000000; safe because no code references the column, so old dynos during a rolling deploy cannot break)
  • Keep ignored_columns on the model to guard stale schema caches, matching the can_log_in precedent

If non-Member recipients ever need email logging, re-add the column together with a real polymorphic association.

Testing

Migration applied to dev and test databases; member_mailer and three_month_email_service specs pass (32 examples, including the chaser logging spec that writes rows through the concern). RuboCop clean.

Context

Found during the #2384 brainstorm while investigating the table's history.

Added in PR #2449 for polymorphism that was never built: no code reads
or writes it, and it is NULL in all production rows (recipients are
always Members). The model ignores the column so stale schema caches
during rolling deploys are safe. Re-add with a polymorphic association
if non-member recipients ever arrive.

@olleolleolle olleolleolle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We thank it and let it go.

@mroderick
mroderick merged commit 0706f03 into master Aug 31, 2026
10 checks passed
@mroderick
mroderick deleted the chore/remove-unused-member-type branch August 31, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants